package com.wyp.utils.validator;


import org.apache.commons.lang3.StringUtils;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * 校验手机号格式
 *
 * @author: Oliver
 */
public class ValidatorUtil {
    //校验的格式
    private static final Pattern mobile_pattern = Pattern.compile("1\\d{10}");

    public static Boolean isMobile(String value) {
        if (StringUtils.isEmpty(value)) {
            return false;
        }
        Matcher matcher = mobile_pattern.matcher(value);
        //返回是否匹配
        return matcher.matches();
    }


    	public static void main(String[] args) {
			System.out.println(isMobile("18912341234"));
			System.out.println(isMobile("1891234123"));
	}
}
